<HTML><HEAD><TITLE>complementary_graph(+Graph, ?ComplementaryGraph)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(grasper)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>complementary_graph(+Graph, ?ComplementaryGraph)</H1>
Obtains the complementary graph of a given graph.
<DL>
<DT><EM>Graph</EM></DT>
<DD>A graph.
</DD>
<DT><EM>ComplementaryGraph</EM></DT>
<DD>The complementary graph of Graph.
</DD>
</DL>
<H2>Description</H2>
Obtains the complementary graph of a given graph.
<H3>Fail Conditions</H3>
Fails 
			 if Graph is not a graph variable or
			 if Graph can not be constrained to have ComplementaryGraph as its complementary graph (ComplementarGraph is a graph variable).
			
<H2>Examples</H2>
<PRE>
?- complementary_graph(G,CG).
No.

?- V`::[]..[1,2,3], E`::[[1,2]]..[[1,2],[2,3],[3,1]], CE`::[]..[[1,2],[3,2],[1,3]], dirgraph(G,V,E), dirgraph(CG,V,CE), complementary_graph(G,CG).
No.

?- V`::[]..[1,2,3], E`::[[1,2]]..[[1,2],[2,3],[3,1]], dirgraph(G,V,E), complementary_graph(G,CG), graph_labeling(G).
V = [1, 2]
E = [[1, 2]]
G = dirgraph([1, 2], [[1, 2]])
CG = dirgraph([1, 2], [[1, 1], [2, 1], [2, 2]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2]]
G = dirgraph([1, 2, 3], [[1, 2]])
CG = dirgraph([1, 2, 3], [[1, 1], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [3, 1]]
G = dirgraph([1, 2, 3], [[1, 2], [3, 1]])
CG = dirgraph([1, 2, 3], [[1, 1], [1, 3], [2, 1], [2, 2], [2, 3], [3, 2], [3, 3]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [2, 3]]
G = dirgraph([1, 2, 3], [[1, 2], [2, 3]])
CG = dirgraph([1, 2, 3], [[1, 1], [1, 3], [2, 1], [2, 2], [3, 1], [3, 2], [3, 3]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [2, 3], [3, 1]]
G = dirgraph([1, 2, 3], [[1, 2], [2, 3], [3, 1]])
CG = dirgraph([1, 2, 3], [[1, 1], [1, 3], [2, 1], [2, 2], [3, 2], [3, 3]])
Yes

?- V`::[]..[1,2,3], E`::[]..[[1,2],[2,3],[3,1]], CE`::[[2,3],[3,2]]..[[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[3,2],[3,3]], dirgraph(G,V,E), dirgraph(CG,V,CE), complementary_graph(G,CG), graph_labeling(G).
V = [2, 3]
E = []
CE = [[2, 2], [2, 3], [3, 2], [3, 3]]
G = dirgraph([2, 3], [])
CG = dirgraph([2, 3], [[2, 2], [2, 3], [3, 2], [3, 3]])
Yes
			</PRE>

</BODY></HTML>
